<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucPageControl.ascx.cs"
    Inherits="usercontrol_ucPageControl" EnableTheming="true" %>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">

    function valComments_ClientValidate(source, args) {

        if (args.Value < 1)

            args.IsValid = false;

        else

            args.IsValid = true;

    }


    function valComments_ClientValidateNextPage(source, args) {

        var sID = source.id;

        var cntl = sID.substring(0, sID.lastIndexOf("_") + 1) + 'lblHidTotalPage';

        if (parseInt(args.Value) > parseInt(document.getElementById(cntl).innerHTML))

            args.IsValid = false;

        else

            args.IsValid = true;

    }
</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <contenttemplate>
    <div id="footer">
        <table id="footer" width="100%" cellpadding="0" cellspacing="2" border="0">
            <tr>
                <td style="width: 25%" align="left">
                    <table cellpadding="0" cellspacing="2" border="0">
                        <tr>
                            <td valign="bottom" align="left">
                                <asp:ImageButton ID="imgbtnFirst" runat="server" CausesValidation="False" ToolTip="First Page" ImageUrl="~/css/images/grid_first_page.gif"
                                    OnCommand="NavigationLink_Click" CommandName="First" ImageAlign="Middle" Style='vertical-align: middle;
                                    padding 0px 0px 0px 0px;'></asp:ImageButton>
                                <asp:ImageButton ID="imgbtnPrev" runat="server" CausesValidation="False" ToolTip="Previous Page" ImageUrl="~/css/images/grid_prev_page.gif"
                                    OnCommand="NavigationLink_Click" CommandName="Prev" ImageAlign="Middle" Style='vertical-align: middle;
                                    padding 0px 2px 0px 0px;'></asp:ImageButton>
                            </td>
                            <td valign="middle">
                                <asp:Label ID="lblPage" Style="vertical-align: middle; padding-left: 3px; padding-right: 0px;" runat="server"
                                    Text="Page"></asp:Label>
                            </td>
                            <td valign="bottom" align="left">
                                <asp:TextBox ID="txtHidCurrPage" runat="server" AutoPostBack="True" OnTextChanged="txtHidCurrPage_TextChanged"
                                    Width="20px" Height="13px" Style="vertical-align: middle; text-align: right;" MaxLength="5" dir="rtl"></asp:TextBox>&nbsp;
                            </td>
                            <td valign="middle" align="right">
                                <asp:Label ID="lblOf" runat="server" Style="vertical-align: middle; padding-right: 0px;" Text="of"></asp:Label>
                            </td>
                            <td id="TDlblof" valign="middle" align="right" runat="server">
                                <asp:Label ID="lblHidTotalPage" Style="vertical-align: middle;" runat="server"></asp:Label>
                            </td>
                            <td valign="middle" align="left">
                                <asp:ImageButton ID="imgbtnNext" runat="server" CausesValidation="False" ToolTip="Next Page" ImageUrl="~/css/images/grid_next_page.gif"
                                    OnCommand="NavigationLink_Click" CommandName="Next" ImageAlign="Middle" Style='vertical-align: middle;
                                    padding 0px 0px 0px 0px;'></asp:ImageButton>
                                <asp:ImageButton ID="imgbtnLast" runat="server" CausesValidation="False" ToolTip="Last Page" ImageUrl="~/css/images/grid_last_page.gif"
                                    OnCommand="NavigationLink_Click" CommandName="Last" ImageAlign="Middle" Style='vertical-align: middle;
                                    padding 0px 0px 0px 0px;'></asp:ImageButton>
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width: 25%" align="center">
                    <table width="100%" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td valign="top" align="center">
                                <asp:Label ID="lblTotalnoofrecords" runat="server" Text="Total Number of Records" Visible="true"></asp:Label>
                                <asp:Label ID="Totalnoofrecords" runat="server"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width: 35%" align="right">
                    <table width="100%" cellpadding="0" cellspacing="0" border="0">
                        <tr>
                            <td valign="middle" style="width: 180px;">
                                <asp:Label ID="lblRecords" runat="server" Text="Records Per Page" Visible="true"></asp:Label>&nbsp;
                            </td>
                            <td valign="middle" align="right" style="width: 8%;">
                                <asp:DropDownList ID="ddRecords" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddRecords_SelectedIndexChanged">
                                    <asp:ListItem Selected="True">10</asp:ListItem>
                                    <asp:ListItem>25</asp:ListItem>
                                    <asp:ListItem>50</asp:ListItem>
                                    <asp:ListItem>75</asp:ListItem>
                                    <asp:ListItem>100</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td align="right" valign="middle" id="tdExcel" runat="server" style="width: 5px;">
                                <%--<asp:ImageButton ID="btnExportExcel" runat="server" Style="padding: 0px 2px 0px 2px;"
                                    ImageUrl="~/App_Themes/Default/Images/excel_icon.png" ToolTip="Export"
                                    CausesValidation="False" UseSubmitBehavior="False" OnClick="btnExportExcel_Click" />--%>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <asp:CustomValidator ID="cvPrevPage" runat="server" ControlToValidate="txtHidCurrPage" ErrorMessage="Should be greater than 0."
            SetFocusOnError="True" Display="none" ClientValidationFunction="valComments_ClientValidate" ValidationGroup="UserControl"></asp:CustomValidator>
        <asp:CustomValidator ID="cvNextPage" runat="server" ControlToValidate="txtHidCurrPage" ErrorMessage="Should be Less than Total Pages."
            SetFocusOnError="True" Display="none" ClientValidationFunction="valComments_ClientValidateNextPage"
            ValidationGroup="UserControl">
        </asp:CustomValidator>
        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtHidCurrPage"
            FilterType="Numbers">
        </cc1:FilteredTextBoxExtender>
        </div>
    </contenttemplate>
</asp:UpdatePanel>
